package artid.com.arttogo.bean;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * 
*    
* 项目名称：ArtworkArt   
* 类名称：AuctionLotListParser   
* 类描述：拍卖行-拍品列表   
* 创建人：耿卫斌   
* 创建时间：2017-3-15 下午5:35:39   
*
 */
public class AuctionLotListParser extends AppItem implements Serializable {
	private static final long serialVersionUID = 1L;
	private int recordnum;//备案拍品数量
	private int lotnum;//拍品数量
	private List<AuctionLotList_Lotinfo> lotinfo=new ArrayList<AuctionLotList_Lotinfo>();//
	@Override
	public void parse(JSONObject obj) {
		// TODO Auto-generated method stub
		if (null == obj) {
			return;
		}
		recordnum = obj.optInt("recordnum");
		lotnum = obj.optInt("lotnum");
		JSONArray array = obj.optJSONArray("lotinfo");
		for (int i = 0; i < array.length(); i++) {
			AuctionLotList_Lotinfo mAuctionLotList_Lotinfo = new AuctionLotList_Lotinfo();
			try {
				mAuctionLotList_Lotinfo.setAddress(array.optJSONObject(i).getString("address"));
				mAuctionLotList_Lotinfo.setChart_num(array.optJSONObject(i).getString("chart_num"));
				mAuctionLotList_Lotinfo.setHeight(array.optJSONObject(i).getInt("height"));
				mAuctionLotList_Lotinfo.setId(array.optJSONObject(i).getString("id"));
				mAuctionLotList_Lotinfo.setImgurl(array.optJSONObject(i).getString("imgurl"));
				mAuctionLotList_Lotinfo.setIs_note(array.optJSONObject(i).getInt("is_note"));
				mAuctionLotList_Lotinfo.setIs_record(array.optJSONObject(i).getString("is_record"));
				mAuctionLotList_Lotinfo.setLot_author(array.optJSONObject(i).getString("lot_author"));
				mAuctionLotList_Lotinfo.setLot_name(array.optJSONObject(i).getString("lot_name"));
				mAuctionLotList_Lotinfo.setLot_price(array.optJSONObject(i).getString("lot_price"));
				mAuctionLotList_Lotinfo.setSeller_name(array.optJSONObject(i).getString("seller_name"));
				mAuctionLotList_Lotinfo.setUnit(array.optJSONObject(i).getString("unit"));
			} catch (JSONException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			lotinfo.add(mAuctionLotList_Lotinfo);
		}
	}
	public int getRecordnum() {
		return recordnum;
	}
	public void setRecordnum(int recordnum) {
		this.recordnum = recordnum;
	}
	public int getLotnum() {
		return lotnum;
	}
	public void setLotnum(int lotnum) {
		this.lotnum = lotnum;
	}
	public List<AuctionLotList_Lotinfo> getLotinfo() {
		return lotinfo;
	}
	public void setLotinfo(List<AuctionLotList_Lotinfo> lotinfo) {
		this.lotinfo = lotinfo;
	}
	public AuctionLotListParser() {
		super();
	}
	public AuctionLotListParser(int recordnum, int lotnum,
								List<AuctionLotList_Lotinfo> lotinfo) {
		super();
		this.recordnum = recordnum;
		this.lotnum = lotnum;
		this.lotinfo = lotinfo;
	}
	@Override
	public String toString() {
		return "AuctionLotListParser [recordnum=" + recordnum + ", lotnum="
				+ lotnum + ", lotinfo=" + lotinfo + "]";
	}
	public class AuctionLotList_Lotinfo implements Serializable {
		private static final long serialVersionUID = 1L;
		private int is_note;//笔记状态0未记笔记，1为记过笔记
		private String lot_price;//拍品成交价
		private int height;//高度
		private String imgurl;//拍品图
		private String lot_name;//拍品名称
		private String lot_author;//拍品作者
		private String chart_num;//图录号
		private String is_record;//备案状态
		private String id;//拍品id
		private String unit;//成交额单位
		private String seller_name;//机构名称
		private String address;//所在城市
		public int getIs_note() {
			return is_note;
		}
		public void setIs_note(int is_note) {
			this.is_note = is_note;
		}
		public String getLot_price() {
			return lot_price;
		}
		public void setLot_price(String lot_price) {
			this.lot_price = lot_price;
		}
		public int getHeight() {
			return height;
		}
		public void setHeight(int height) {
			this.height = height;
		}
		public String getImgurl() {
			return imgurl;
		}
		public void setImgurl(String imgurl) {
			this.imgurl = imgurl;
		}
		public String getLot_name() {
			return lot_name;
		}
		public void setLot_name(String lot_name) {
			this.lot_name = lot_name;
		}
		public String getLot_author() {
			return lot_author;
		}
		public void setLot_author(String lot_author) {
			this.lot_author = lot_author;
		}
		public String getChart_num() {
			return chart_num;
		}
		public void setChart_num(String chart_num) {
			this.chart_num = chart_num;
		}
		public String getIs_record() {
			return is_record;
		}
		public void setIs_record(String is_record) {
			this.is_record = is_record;
		}
		public String getId() {
			return id;
		}
		public void setId(String id) {
			this.id = id;
		}
		public String getUnit() {
			return unit;
		}
		public void setUnit(String unit) {
			this.unit = unit;
		}
		public String getSeller_name() {
			return seller_name;
		}
		public void setSeller_name(String seller_name) {
			this.seller_name = seller_name;
		}
		public String getAddress() {
			return address;
		}
		public void setAddress(String address) {
			this.address = address;
		}
		public AuctionLotList_Lotinfo() {
			super();
		}
		public AuctionLotList_Lotinfo(int is_note, String lot_price,
									  int height, String imgurl, String lot_name, String lot_author,
									  String chart_num, String is_record, String id, String unit,
									  String seller_name, String address) {
			super();
			this.is_note = is_note;
			this.lot_price = lot_price;
			this.height = height;
			this.imgurl = imgurl;
			this.lot_name = lot_name;
			this.lot_author = lot_author;
			this.chart_num = chart_num;
			this.is_record = is_record;
			this.id = id;
			this.unit = unit;
			this.seller_name = seller_name;
			this.address = address;
		}
		@Override
		public String toString() {
			return "AuctionLotList_Lotinfo [is_note=" + is_note
					+ ", lot_price=" + lot_price + ", height=" + height
					+ ", imgurl=" + imgurl + ", lot_name=" + lot_name
					+ ", lot_author=" + lot_author + ", chart_num=" + chart_num
					+ ", is_record=" + is_record + ", id=" + id + ", unit="
					+ unit + ", seller_name=" + seller_name + ", address="
					+ address + "]";
		}
	}
	
}
